 function login () {
        // body...
      
        var myname = document.getElementById('user').value;
        var pass = document.getElementById('pass').value;

        if (myname == "" || pass == ""){
            $('#myModal').modal('show');
            return
        }else{
            var target = "http://"+window.location.host+"/login";//--获取地址
            alert(target);
            var user = {
                "user":myname,
                "pass":pass
            };
            $.ajax({
            type:'POST',
            async:false,
            url:target,
            data:user,
            dataType:"json",
            success: function(ret){       
                if(ret.Code == 7){

                     location.href = "/";
                 }else if(ret.Code == 5){

                   document.getElementById('myModalLabel').innerHTML = "此用户没有注册喔，请点击注册加入我们吧";
                   $('#myModal').modal('show');
                }else if(ret.Code == 6){

                    document.getElementById('myModalLabel').innerHTML = "密码错误!";
                    $('#myModal').modal('show');
                }else{
		
                     document.getElementById('myModalLabel').innerHTML = "未知错误!";
                     $('#myModal').modal('show');
                     location.href = "/login";
                }
            }
            });
        }
}
function regis(){
     location.href = "/login";
}